<include file="public@header"/>
</head>
<body>
<div class="lyear-layout-web">
        <div class="lyear-layout-container">
            <!--页面主要内容-->
            <main class="lyear-layout-content">
              
                <div class="container-fluid">
                
                    <div class="row">
                       <div class="col-lg-12">
                            <div class="card">
                            <ul class="nav nav-tabs">
                                <li class="active"><a href="{:url('link/index')}">所有友情链接</a></li>
                                <li><a href="{:url('link/add')}">添加友情链接</a></li>
                            </ul>
                            <div class="card-body js-check-wrap">
                                <form method="post" class="js-ajax-form margin-top-20" action="{:url('Link/listOrder')}">
                                    <div class="table-actions">
                                        <button class="btn btn-sm btn-primary js-ajax-submit" type="submit">{:lang('SORT')}</button>
                                        <button class="btn btn-sm btn-success js-ajax-submit" type="submit"
                                                data-action="{:url('link/toggle',array('display'=>1))}" data-subcheck="true">{:lang('DISPLAY')}
                                        </button>
                                        <button class="btn btn-sm btn-danger js-ajax-submit" type="submit"
                                                data-action="{:url('link/toggle',array('hide'=>1))}" data-subcheck="true">{:lang('HIDE')}
                                        </button>
                                    </div>
                                    <php>$status=array("1"=>lang('DISPLAY'),"0"=>lang('HIDDEN'));</php>
                                    <div class="table-responsive">
                                      <table class="table table-hover">
                                        <thead>
                                        <tr>
                                            <th width="16"><label class="lyear-checkbox checkbox-primary">
                                                <input type="checkbox" class="js-check-all" data-direction="x"
                                                                         data-checklist="js-check-x"><span></span></label></th>
                                            <th width="50">{:lang('SORT')}</th>
                                            <th width="50">ID</th>
                                            <th>{:lang('NAME')}</th>
                                            <th>链接地址</th>
                                            <th width="50">{:lang('STATUS')}</th>
                                            <th width="120">{:lang('ACTIONS')}</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <foreach name="links" item="vo">
                                            <tr>
                                                <td>
                                                    <label class="lyear-checkbox checkbox-primary">
                                                    <input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]"
                                                           value="{$vo.id}"><span></span>
                                                       </label></td>
                                                <td><input name='list_orders[{$vo.id}]' class="input input-order mr5" type='text' size='3'
                                                           value='{$vo.list_order}'></td>
                                                <td>{$vo.id}</td>
                                                <td>{$vo.name}</td>
                                                <td><a href="{$vo.url}" target="_blank">{$vo.url}</a></td>
                                                <td>
                                                    <empty name="vo.status">
                                                        <span class="label label-default">
                                                            {$status[$vo['status']]}
                                                        </span>
                                                        <else/>
                                                        <span class="label label-success">
                                                            {$status[$vo['status']]}
                                                        </span>
                                                    </empty>
                                                </td>
                                                <td>
                                                    <a class="btn btn-xs btn-primary" href="{:url('link/edit',array('id'=>$vo['id']))}">{:lang('EDIT')}</a>
                                                    <a class="btn btn-xs btn-danger" href="{:url('link/delete',array('id'=>$vo['id']))}" class="js-ajax-delete">
                                                        {:lang('DELETE')}
                                                    </a>
                                                </td>
                                            </tr>
                                        </foreach>
                                        </tbody>
                                        <tfoot>
                                        <tr>
                                            <th width="16">
                                                <label class="lyear-checkbox checkbox-primary">
                                                    <input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x">
                                                    <span></span>
                                                </label>
                                            </th>
                                            <th width="50">{:lang('SORT')}</th>
                                            <th width="50">ID</th>
                                            <th>{:lang('NAME')}</th>
                                            <th>链接地址</th>
                                            <th width="50">{:lang('STATUS')}</th>
                                            <th width="120">{:lang('ACTIONS')}</th>
                                        </tr>
                                        </tfoot>
                                        </table>
                                    </div>
                                    <div class="table-actions">
                                        <button class="btn btn-sm btn-primary js-ajax-submit" type="submit">{:lang('SORT')}</button>
                                        <button class="btn btn-sm btn-success js-ajax-submit" type="submit"
                                                data-action="{:url('link/toggle',array('display'=>1))}" data-subcheck="true">{:lang('DISPLAY')}
                                        </button>
                                        <button class="btn btn-sm btn-danger js-ajax-submit" type="submit"
                                                data-action="{:url('link/toggle',array('hide'=>1))}" data-subcheck="true">{:lang('HIDE')}
                                        </button>
                                    </div>
                                </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </main>
        </div>
    </div>
<script src="__TMPL__/public/assets/js/admin.js"></script>
</body>
</html>